package shiyongapi;

import org.junit.Test;

import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Auther ljn
 * @Date 2019/11/22
 * 生成uuid
 */
public class GenerateUUID {
    public static void main(String[] args) {
/*        String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
        System.out.println(uuid);*/

        String uuid2 = UUID.randomUUID().toString().toLowerCase();
        System.out.println(uuid2); //41ea5f9e-15c2-4adf-8664-1dc6e5fb9d8d

    }

    @Test
    public void test01(){
        Pattern pattern = Pattern.compile("(?<=234)abc");
        Matcher matcher = pattern.matcher("abc123abc234abcdef");
        while (matcher.find()){
            System.out.println(matcher.group());
            System.out.println(matcher.start() + "-----" + matcher.end());
        }
    }
}
